# 输入某年某月某日，判断这一天是这一年的第几天。

def is_leap_year(year):
    if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
        return True
    else:
        return False

def days_of_month(year, month):
    if month in [1, 3, 5, 7, 8, 10, 12]:
        return 31
    elif month in [4, 6, 9, 11]:
        return 30
    elif month == 2:
        if is_leap_year(year):
            return 29
        else:
            return 28
    else:
        return "月份输入错误"

if __name__ == '__main__':
    year = int(input("请输入年份："))
    month = int(input("请输入月份："))
    day = int(input("请输入日期："))

    days = 0
    for i in range(1, month):
        days += days_of_month(year, i)
    days += day

    print("这一天是这一年的第{}天".format(days))